<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateExpensesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('expenses', function (Blueprint $table) {
            $table->id();
            $table->string('order_sn')->nullable()->comment('订单编号');
            $table->string('key')->nullable()->comment('键名');
            $table->string('value')->nullable()->comment('键值');
            $table->decimal('return_price',10,2)->default(0.00)->comment('清退金额');
            $table->decimal('infact_price',10,2)->default(0.00)->comment('实际金额');
            $table->timestamp('collection_period')->nullable()->comment('收款期限');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('expenses');
    }
}
